package ClassData;

import ClassData.Visitor.IVisitor;
import ClassData.Visitor.IVisitorElement;

public class ConstantPoolField_Info extends ConstantPoolInfo implements IVisitorElement {

	private short name_index;
	private short descriptor_index;
	
	/**
	  *  
	  * 
	  * @param nameIndex index to field name in constant pool
	  * @param descriptorIndex index to this field descriptor
	  * 
	 */		
		
	public ConstantPoolField_Info(short nameIndex,short descriptorIndex) {
		name_index=nameIndex;
		descriptor_index=descriptorIndex;
	}

	public short getNameIndex() {
		return(name_index);
	}

	public short getDescriptorIndex() {
		return(descriptor_index);
	}

	/**
	 * returns type of this constant pool entry
	 * 
	 */	
	public int getType() {
		return(CONSTANT_Fieldref);
	}
	
	@Override
	public void receive_Visitor(IVisitor visitor) {
		visitor.visit_ConstantPoolField_Info(this);
	}
	
}
